package cn.net.yugu.doraemon.springweb.util;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;

/**
 * @description:
 * @author: liujun
 * @create: 2023/11/8 14:12
 */
@Slf4j
public class JSONUtil {
    public static String toJSONString(Object body) {
        try {
            return JSON.toJSONString(body);
        } catch (Exception e) {
            //fastjson序列化list可能报错
            log.error("toJsonString error", e);
        }
        return null;
    }
}
